<?php
namespace Modules\Frontend\Controllers;

class ConfigController extends ControllerBase {
  public function indexAction() {
    $constants['user_wallet_record_type'] = \Components\User\Sha\Wallet\Record\Constants::getByIndex('user_wallet_record_type');
    $constants['user_wallet_record_fields'] = \Components\User\Sha\Wallet\Constants::getByIndex('user_wallet_record_fields');
    $constants['user_wallet_record_fields_name'] = \Components\User\Sha\Wallet\Constants::getByIndex('user_wallet_record_fields_name');

    $constants['user_mutually_buy_status'] = \Components\User\Sha\Mutually\Buy\Constants::getByIndex('user_mutually_buy_status');
    $constants['user_mutually_buy_average_status'] = \Components\User\Sha\Mutually\Buy\Constants::getByIndex('user_mutually_buy_average_status');

    $constants['user_mutually_sell_status'] = \Components\User\Sha\Mutually\Sell\Constants::getByIndex('user_mutually_sell_status');
    $constants['user_mutually_sell_average_status'] = \Components\User\Sha\Mutually\Sell\Constants::getByIndex('user_mutually_sell_average_status');

    $parameters = $this -> parameters -> getSharedFactory() -> getFacade() -> findByKeyUseCacheIsDisabled();

    return $this -> returnSuccessByJson(['msg' => 'Success','constants'=>$constants,'parameters'=>$parameters]);
  }
}
